// 04jyhs/bizAdmin/JyhsbManage/02lookMoney/lookMoney.js
var co = require('../../../../resource/js/common.js')
var app = getApp()
var _this, _data, _opt
var _pageNum = 1
Page({
   data: {
      details: [],
      hint: true,
      win_height: 1800,
   },
   onLoad(opt) {
      _this = this
      _data = _this.data
      _opt = opt
      _this.setData({
         win_height: wx.getSystemInfoSync().windowHeight + 10
      })
      _this.getMoneyRecord()
   },

   onUnload() {
      _pageNum = 1
   },
   onReachBottom() {
      _this.getMoneyRecord()
   },
   //获取资金流水记录
   getMoneyRecord() {
      var param = {
         page: _pageNum,
         User_ID: _opt.User_ID
      }
      co.getJyhsApi("money/Recorduser/getList", param, function(res) {
         if (res.code == 0) {
            var list = _data.details
            _this.setData({
               details: list.concat(res.data)
            })
            _pageNum++
            co.toastAllText(res.msg)
         } else {
            _this.setData({
               hint: false
            })
            co.toastAllText('没有记录了')
         }
      })
   },
})